import * as types from '../ActionTypeConf';

const initialState = null;

export default (state = initialState, action) => {
  switch (action.type) {
    case types.USER_EDIT: // 编辑个人信息
      let tempObj = {};
      Object.assign(tempObj, state, action.user);
      return tempObj;

    case types.USER_CLEAR: // 清除个人信息
      return initialState;

    default:
      return state;
  }
};
